1. Field of the Invention
The present invention relates to a method of forming an executable program from a number of object code modules and generating associated debugging information.
2. Description of the Related Art
Generally speaking, a single executable program is formed by linking a number of object code modules using a software tool called a linker. Object code modules are usually generated from program source code modules, these modules being written in a high level language. An assembler/compiler reads each source code module and assembles and/or compiles the high level language of the source code module to produce an object code module. The assembler also generates a number of relocations that are used to combine the object code modules at link time in a linker.
An example of a linker standard is ELF (executable linking format). This standard defines a convention for naming relocations belonging to a given section, e.g., rela.abc is relocation section of section .abc. Standard relocations under the ELF format allow an offset in section data to be defined where patching is to occur and a symbol whose value is to be patched. A type field also exists which is used to describe the appropriate method of encoding the value of the symbol into the instruction or data of the section data being patched.
As is also known, extra information associated with the executable program, but not directly part of it, may be included in the program. One example of such information is debugging information called Call Frame Information (CFI). CFI records how to restore the parent program stack to the state it was in before a particular function was executed by the parent program. This aids in the debugging of the parent program. CFI is normally generated dung compilation and stored in the executable parent program.
The fact that the CFI is generated during compilation, that is before linking, means that it is not possible to perform patching of the section data to optimize the executable program code because such patching could change the location of a set of section data so that the CFI that is relevant to that set of section data is no longer associated with the correct location and is thus no longer of any use.